﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleFactory
{
    public class OrderPizza
    {
        private string Name;
        public OrderPizza(string name)
        {
            this.Name = name;
        }

        public void Order(string type)
        {
            var pizza = default(Pizza);

            switch (type)
            {
                case "cheese":
                    {
                        pizza = new CheesePizza();
                        break;
                    }
                case "greek":
                    {
                        pizza = new GreekPizza();
                        break;
                    }
                default:
                    {
                        throw new Exception("pizza type invalid");
                    }
            }

            Console.WriteLine($"{Name} order one {type} pizza...");

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();
        }
    }
}
